package com.zmn.plat.persistence.interfaces.channel;

import com.zmn.plat.model.entity.channel.ChannelSettle;
import com.zmn.plat.model.entity.channel.ChannelSettleQuery;
import com.zmn.plat.model.entity.channel.ChannelSettleVO;

import java.util.List;

/**
 * ChannelSettleDAO继承基类
 *
 * @author tanghongjun
 */
public interface ChannelSettleDAO {
    /**
     * 描述: ChannelSettle key 查询数据
     *
     * @param channelId
     * @return: ChannelSettle
     * @auther: tanghongjun
     * @since: 2018/10/15 16:41
     */
    ChannelSettle findByKey(Integer channelId);

    /**
     * 描述:查询最大key
     *
     * @return: channelId
     * @auther: tanghongjun
     * @since: 2018/10/15 16:41
     */
    Integer findKeyForMax();

    /**
     * 描述: 根据查询条件分页查询
     *
     * @param query
     * @return: List<ChannelSettle>
     * @auther: tanghongjun
     * @since: 2018/10/15 16:41
     */
    List<ChannelSettle> listPageByQuery(ChannelSettleQuery query);

    /**
     * 描述: 根据查询条件查询所有数据
     *
     * @param query
     * @return: List<ChannelSettle>
     * @auther: tanghongjun
     * @since: 2018/10/15 16:41
     */
    List<ChannelSettleVO> listByQuery(ChannelSettleQuery query);

    /**
     * 描述: ChannelSettle 数据
     *
     * @return: List<ChannelSettle>
     * @auther: tanghongjun
     * @since: 2018/10/15 16:41
     */
    List<ChannelSettle> listAll();

    /**
     * 描述: 获取二级渠道结算信息
     *
     * @return: List<ChannelSettle>
     * @auther: tanghongjun
     * @since: 2018/10/15 16:41
     */
    List<ChannelSettle> listWithLevelTwo();

    /**
     * 获取所有非啄金客类型的二级渠道的渠道结算信息
     *
     * @return List<ChannelSettle>
     * @auther xiangjunming
     * @since 2020/01/06 18:42
     */
    List<ChannelSettle> listByNotCps();

    /**
     * 描述: 根据查询条件统计满足条件的数据条数
     *
     * @param query
     * @return: Integer
     * @auther: tanghongjun
     * @since: 2018/10/15 16:41
     */
    Integer countByQuery(ChannelSettleQuery query);

    /**
     * 描述: 根据主键修改数据
     *
     * @param channelSettle
     * @return: 执行结果码
     * @auther: tanghongjun
     * @since: 2018/10/15 16:41
     */
    Integer updateByKey(ChannelSettle channelSettle);

    /**
     * 描述: 新增数据
     *
     * @param channelSettle
     * @return: 执行结果码
     * @auther: tanghongjun
     * @since: 2018/10/15 16:41
     */
    Integer insert(ChannelSettle channelSettle);

    /**
     * 描述: 根据主键删除数据
     *
     * @param channelId
     * @return: 执行结果码
     * @auther: tanghongjun
     * @since: 2018/10/15 16:41
     */
    Integer deleteByKey(Integer channelId);
}